<?php

require_once('../Connections/petuion.php');
require('../include/simpleHeader.php');


if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$maxRows_DetailRS1 = 10;
$pageNum_DetailRS1 = 0;
if (isset($_GET['pageNum_DetailRS1'])) {
  $pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
}
$startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;

$colname_DetailRS1 = "-1";
if (isset($_GET['PAId'])) {
  $colname_DetailRS1 = $_GET['PAId'];
}
mysql_select_db($database_petuion, $petuion);
$query_DetailRS1 = sprintf("SELECT * FROM pet_info WHERE PAId = %s", GetSQLValueString($colname_DetailRS1, "int"));
$query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
$DetailRS1 = mysql_query($query_limit_DetailRS1, $petuion) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);

if (isset($_GET['totalRows_DetailRS1'])) {
  $totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
} else {
  $all_DetailRS1 = mysql_query($query_DetailRS1);
  $totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
}
$totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
?><?php require_once('../Connections/petuion.php'); ?>

<link href="../Felix_css.css" rel="stylesheet" type="text/css" />
<body topmargin="0" leftmargin="0">
<table width="777" border="0" align="left" cellpadding="0" cellspacing="0" valign="top">
  <tr>
    <td width="777" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="51" valign="top" background="../images/fen_09.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="16">&nbsp;</td>
            </tr>
          </table>
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="14"><img src="../images/fen_12.gif" width="7" height="29"></td>
              <td width="405"><span class="font_16px_black_B">详细信息</span></td>
              <td width="15">&nbsp;</td>
              <td width="299" align="right" class="font_12px_gray"><a  href="javascript:history.go(-1);">[<?php echo TEXT_BACK?>]</a></td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="1" bgcolor="#767676"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="8"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top" class="font_12px_gray"><table width="735" border="0" align="center" cellpadding="0" cellspacing="0" class="font_12px_gray">
            <tr>
              <td width="100" height="30" align="left" valign="middle"><div align="left"><strong>编号：</strong></div></td>
              <td width="100"><?php echo $row_DetailRS1['PAId']; ?></td>
              <td width="100"><div align="left"><strong>姓名：</strong></div></td>
              <td width="100"><?php echo $row_DetailRS1['PAPetName']; ?></td>
              <td width="100"><div align="left"><strong>性别：</strong></div></td>
              <td width="100"><?php echo $row_DetailRS1['PGender']; ?></td>
            </tr>
            <tr>
              <td width="100" height="30" align="left" valign="middle"><div align="left"><STRONG>种类：</STRONG></div></td>
              <td width="100"><?php echo $row_DetailRS1['PType']; ?></td>
              <td width="100"><div align="left"><STRONG>品种：</STRONG></div></td>
              <td width="100"><?php echo $row_DetailRS1['PVariety']; ?></td>
              <td width="100"><div align="left"><strong>收养状态：</strong></div></td>
              <td width="100"><?php echo $row_DetailRS1['PIsAdopt']; ?></td>
            </tr>
                        <tr>
              <td width="100" height="30" align="left" valign="middle"><div align="left"><strong>收养人：</strong></div></td>
              <td width="100"><?php echo $row_DetailRS1['PAAdopter']; ?></td>
              <td width="100"><div align="left"><strong>收养日期：</strong></div></td>
              <td width="100"><?php echo $row_DetailRS1['PADate']; ?></td>
              <td width="100"><div align="left"></div></td>
              <td width="100">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="6"><p><STRONG>详细描述：</STRONG></p>
                <p><?php echo $row_DetailRS1['PDescription']; ?></p>
                <p><img src="../Common/ShowImageAdopt.php?PAId=<?php echo $_GET['PAId']; ?>&Rnd=<?php echo rand();?>" border="1"/><br>              
                    <br>
                  </p></td>
              </tr>
          </table>
          <p>&nbsp;</p></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="8"></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>

<?php
mysql_free_result($DetailRS1);
?>
